package cloud.example.eureka_client.mapper;

import org.apache.ibatis.annotations.*;

/**
 * @author zjm
 * @date 2018/12/22.
 */
@Mapper
public interface CountMapper {
    @Select("SELECT count FROM count_table WHERE id = #{id}")
    Integer getCount(@Param("id") Integer id);

    @Update("UPDATE count_table SET count=#{count} WHERE id=#{id}")
    void updateCount(@Param("id") Integer id, @Param("count") Integer count);

//    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("INSERT INTO count_table(count) VALUES(#{count})")
    void insert(@Param("count") Integer count);
}
